-- Based on minetest_game
-- Distributed under LGPLv2.1, see lgpl-2_1.txt

minetest.register_node("moreblocks:etherium_crystal_water_source", {
	description = ("Crystal Water Source"),
	drawtype = "liquid",
	waving = 3,
	tiles = {
		{
			name = "moreblocks_etherium_crystal_water_source_animated.png",
			backface_culling = false,
			animation = {
				type = "vertical_frames",
				aspect_w = 16,
				aspect_h = 16,
				length = 2.0,
			},
		},
		{
			name = "moreblocks_etherium_crystal_water_source_animated.png",
			backface_culling = true,
			animation = {
				type = "vertical_frames",
				aspect_w = 16,
				aspect_h = 16,
				length = 2.0,
			},
		},
	},
	alpha = 210,
	paramtype = "light",
	light_source = default.LIGHT_MAX,
	walkable = false,
	pointable = false,
	diggable = false,
	buildable_to = true,
	is_ground_content = false,
	drop = "",
	drowning = 1,
	liquidtype = "source",
	liquid_alternative_flowing = "moreblocks:etherium_crystal_water_flowing",
	liquid_alternative_source = "moreblocks:etherium_crystal_water_source",
	liquid_viscosity = 1,
	liquid_renewable = false,
	post_effect_color = {a = 103, r = 30, g = 60, b = 90},
	groups = {water = 3, liquid = 3, cools_lava = 1},
	sounds = default.node_sound_water_defaults(),
})

minetest.register_node("moreblocks:etherium_crystal_water_flowing", {
	description = ("Crystal Flowing Water"),
	drawtype = "flowingliquid",
	waving = 3,
	tiles = {"moreblocks_etherium_crystal_water.png"},
	special_tiles = {
		{
			name = "moreblocks_etherium_crystal_water_flowing_animated.png",
			backface_culling = false,
			animation = {
				type = "vertical_frames",
				aspect_w = 16,
				aspect_h = 16,
				length = 0.5,
			},
		},
		{
			name = "moreblocks_etherium_crystal_water_flowing_animated.png",
			backface_culling = true,
			animation = {
				type = "vertical_frames",
				aspect_w = 16,
				aspect_h = 16,
				length = 0.5,
			},
		},
	},
	alpha = 200,
	paramtype = "light",
	light_source = default.LIGHT_MAX,
	paramtype2 = "flowingliquid",
	walkable = false,
	pointable = false,
	diggable = false,
	buildable_to = true,
	is_ground_content = false,
	drop = "",
	drowning = 1,
	liquidtype = "flowing",
	liquid_alternative_flowing = "moreblocks:etherium_crystal_water_flowing",
	liquid_alternative_source = "moreblocks:etherium_crystal_water_source",
	liquid_viscosity = 1,
	liquid_renewable = false,
	post_effect_color = {a = 103, r = 30, g = 60, b = 90},
	groups = {water = 3, liquid = 3, not_in_creative_inventory = 1, cools_lava = 1},
	sounds = default.node_sound_water_defaults(),
})

bucket.register_liquid(
	"moreblocks:etherium_crystal_water_source",
	"moreblocks:etherium_crystal_water_flowing",
	"moreblocks:bucket_crystal_water",
	"moreblocks_bucket_crystal_water.png",
	"Crystal Water Bucket",
	{tool = 1, water_bucket = 1},
	false
)
